<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ page import="board1.UserDAO"%>
<%@ page import="board1.UserTO"%>
<%@ page import="java.util.ArrayList"%>

<%
	request.setCharacterEncoding("UTF-8");

	int cpage = 1;
	if (request.getParameter("cpage") != null
			&& !request.getParameter("cpage").equals("")) {
		cpage = Integer.parseInt(request.getParameter("cpage"));
	}
	UserDAO dao = new UserDAO();
%>

<meta http-equiv='content-type' content='text/html;charset=UTF-8'>
<link rel='stylesheet' type='text/css' href='../images/common.css'>

<table>
	<tr>
		<td height='600' valign='top'></td>
		<td valign='top'>
			<table width='750px' border='0' cellpadding='0' cellspacing='0' align='center'>
				<tr>
					<td height='23' bgcolor='#f0f0f0' align='right'></td>
				</tr>
				<tr>
					<td bgcolor='#ffffff' style='padding: 20'>
						<table width='100%' border='0' cellpadding='0' cellspacing='0'>
							<tr>
								<td align='center' class='gline'></td>
							</tr>
							<tr>
								<td align='center'>
									<table width='100%' border='0' cellpadding='0' cellspacing='0'
										class='titlecell'>
										<tr height='25' align='center'>
											<td width='40'>전화번호</td>
											<td>마을</td>
											<td width='100'>이름</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td align='center' class='gline'></td>
							</tr>
							<tr>
								<td height='3'></td>
							</tr>
						</table> <!-- 글 목록 시작 --> <%
 	ArrayList<UserTO> data = dao.listUser();
 	for (int i = 0; i < data.size(); i++) {
 		UserTO to = (UserTO) data.get(i);
 		String phone_number = to.getPhone_number();
 		String chon_id = to.getChon_id();
 		String user_name = to.getUser_name();
  		String user_lv = to.getUser_lv();
//  		String hit = to.getHit();
 		//		String wgap = to.getWgap();
 %>
						<table width='100%' border='0' cellpadding='0' cellspacing='0'>
							<tr>
								<td height='1'></td>
							</tr>
							<tr>
								<td>
									<table width='100%' border='0' cellpadding='0' cellspacing='0'>
										<tr height='25' onMouseOver="this.className='evencell'"
											onMouseOut="this.className=''">
											<td width='40' align='center'><%=phone_number%></td>
											<td><span style='width: 370' class='elltxt'> <a
													href='board_view1.jsp?no=<%=phone_number%>&cpage=<%=cpage%>'><%=chon_id%></a>
											</span></td>
											<td width='100' align='center'><%=user_name%></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td height='1'></td>
							</tr>
							<tr>
								<td align='center' class='imgline'></td>
							</tr>
						</table> <!-- 글 목록 끝 --> <%
 	}
 %>
						<table width='100%' border='0' cellpadding='0' cellspacing='0'>
							<tr>
								<td width='500' height='30'>
									<!-- 페이지 네비게이션 --> <!--  -->
								</td>
								<td align='right'><a
									href='board_write1.jsp?cpage=<%=cpage%>'><img
										src='../images/btn_wri.gif' border='0'></a></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>